unit period;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Mask;

type
  TfmPeriod = class(TForm)
    meFDate: TMaskEdit;
    meLDate: TMaskEdit;
    btnOk: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fmPeriod: TfmPeriod;

implementation

{$R *.DFM}

procedure TfmPeriod.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = 13 then
    FindNextControl(ActiveControl, True, True, True).SetFocus;
  if Key = 27 then Close;
end;

procedure TfmPeriod.FormActivate(Sender: TObject);
begin
  meFDate.SetFocus;
end;

end.
